﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Project_1_refactored_
{
    class gameInterface
    {
        #region GI declarations
        string sGITop = @"GameInterface\gameInterfaceTop";
        string sGIBottom = @"GameInterface\gameInterfaceBottom";
        string sGILeft = @"GameInterface\gameInterfaceLeft";
        string sGIRight = @"GameInterface\gameInterfaceRight";

        Texture2D t2dGITop;
        Texture2D t2dGIBottom;
        Texture2D t2dGILeft;
        Texture2D t2dGIRight;

        Vector2 v2GITop = Vector2.Zero;
        Vector2 v2GIBottom = Vector2.Zero;
        Vector2 v2GILeft = Vector2.Zero;
        Vector2 v2GIRight = Vector2.Zero;
        #endregion

        #region Info declarations
        string infoTxt = "";
        SpriteFont iFont;
        string fontAsset = @"Pericles8";
        Vector2 v2FontLocation = Vector2.Zero;
        #endregion

        #region GI LoadContent, Update, Draw
        public void LoadContent(ContentManager content)
        {
            t2dGITop = content.Load<Texture2D>(sGITop);
            t2dGIBottom = content.Load<Texture2D>(sGIBottom);
            t2dGILeft = content.Load<Texture2D>(sGILeft);
            t2dGIRight = content.Load<Texture2D>(sGIRight);

            v2GIBottom = new Vector2(0, 600 - t2dGIBottom.Height);
            v2GIRight = new Vector2(800 - t2dGIRight.Width, 0);

            //FONT
            iFont = content.Load<SpriteFont>(fontAsset);
            v2FontLocation = new Vector2(t2dGILeft.Width + 5, t2dGITop.Height + 5);
        }

        public void Update(GameTime gameTime)
        { }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(t2dGITop, v2GITop, Color.White);
            spriteBatch.Draw(t2dGIBottom, v2GIBottom, Color.White);
            spriteBatch.Draw(t2dGILeft, v2GILeft, Color.White);
            spriteBatch.Draw(t2dGIRight, v2GIRight, Color.White);

            //TEXT
            spriteBatch.DrawString(iFont, infoTxt, v2FontLocation, Color.Black);
        }
        #endregion

        #region helper methods
        public void setInfo(string info)
        {
            infoTxt = info;
        }
        #endregion
    }
}
